function [mu_U,L_U] = sample_user_hyperparams(U)
[D,N] = size(U);

mu0 = zeros(D,1);
beta0 = 1;
W0 = eye(D);
nu0 = D;

U_bar = mean(U,2);
S_bar = fastCov(U);

mu0_ = (beta0*mu0+N*U_bar)/(beta0+N);
beta0_ = beta0 + N;  
nu0_ = nu0 + N;
W0_ = inv(inv(W0) + N*S_bar + ...
        ((beta0*N)/(beta0*N))*(mu0-U_bar)*(mu0-U_bar)'); 
    
L_U = wishrnd((W0_+W0_')*0.5, nu0_);  
mu_U = mu0_ + chol(inv(beta0_*L_U))'*randn(D,1);